<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div id="app">
        {{ msg }}
        <button @click="updateMsg">更新</button>
        <button @click="deleteVue">销毁</button>
    </div>

    <script src="js/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data(){
                return {
                    msg:"hello vue"
                }
            },
            methods:{
                updateMsg(){
                    this.msg="你好，vue"
                    console.log("msg修改了")
                },
                deleteVue(){
                    this.$destroy()
                }
            },
            beforeCreate(){
                console.log("beforeCreate"+this.msg)
            },
            created(){
                console.log("created"+this.msg)
            },
            beforeMount(){
                console.log("beforeMount"+this.msg)
            },
            mounted(){
                console.log("mounted"+this.msg)
            },
            beforeUpdate(){
                console.log("beforeUpdate"+this.msg)
            },
            updated(){
                console.log("updated"+this.msg)
            },
            beforeDestroy(){
                console.log("beforeDestroy"+this.msg)
            },
            destroyed(){
                console.log("destroy"+this.msg)
            }
        })
    </script>
</body>
</html>